<?php

class Employee extends E_ARB {

	protected $belongs_to = array('user');

	/**
	*
	* user authentication function
	*
	* @param string $username
	* @param string $password
	* @return bool
	*/
	function authenticate($username = '', $password = '') {
		
		$user = new Employee('find', array('first', array("id = '{$username}'")));

		if (isset($user->hashed_password) && $user->hashed_password === sha1($password)) {
			return $user;
		}
		return false;
	}

}

?>